package com.example.everying.task;

import com.example.everying.mapper.content.ActivityApplyMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @program: everything
 * @description: 自动确认完成定时器
 * @author: zw
 * @create: 2025-06-09 14:23
 **/
@Component
@Slf4j
public class CompletedTask {
    @Autowired
    private ActivityApplyMapper applyMapper;

    // 每天凌晨1点
    @Scheduled(cron = "0 0 1 * * ?")
    public void syncCommentsToDatabase() {
        try {
            applyMapper.updateStatus();
        } catch (Exception e) {
            log.error("Error in scheduled likes sync task", e);
        }
    }

}